<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .title{
            line-height: 40px;
            font-weight: bold;
            text-align: center;
        }
        .list .item{
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 20px;
        }
        .list .item img{
            width: 60px;
        }
    </style>
</head>
<body>
     <div id="app">
        <div class="title">任务列表</div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                    <img src="../img/pic.png" alt="">
                </div>
                <div class="middle">
                    <div class="name"> {{ item.name }} </div>
                    <div class="desc"> {{ item.desc }} </div>
                </div>
                <div class="right">
                    <button> {{ item.status == 1 ? '去完成' : (item.status == 2 ? '领取' : '已领取') }} </button>
                </div>
            </div>
        </div>
    </div>

</body>
</html>
<script src="../js/vue-2.5.21.js"></script>
<script>
    
     var v = new Vue({
            
            el:'#app', //el Vue实例挂载的dom节点
            data: {
                tasklist:[
                    { id:1, pic:'', name:'咪咕视频送流量',desc:'每月领500MB流量',status:1 },
                    { id:2, pic:'./pic.png', name:'咪咕视频送福利',desc:'每月领800MB流量',status:2 },
                    { id:3, pic:'./pic.png', name:'咪咕视频送套餐折扣券',desc:'每月领1500MB流量',status:3 },
                    { id:4, pic:'./pic.png', name:'咪咕视频送超级秒杀',desc:'每月领5500MB流量',status:1 },
                ]
            } , 
            computed: {} , //computed 定义计算属性
            watch: {} , //watch 定义数据监听
            methods: {} , //methods 定义方法(函数)
            filters: {} , //filters 定义过滤器
            directives: {} , //directives 定义自定义指令
            components: {} , //components 注册局部组件
        }) 

    </script>
</script>